How to find the Biggest and smallest in Int[] Array using c#

Posted by karthik on Stack Overflow See other posts from Stack Overflow or by karthik
Published on 2010-04-20T09:58:59Z Indexed on 2010/04/20 10:03 UTC
Read the original article Hit count: 149

Filed under:
|
|

If the array is as follows,

int[] array = new int[] { 7, 4, 1, 8 };

I want to find the Biggest, smallest, second smallest, second biggest

If the array is as follows,

int[] array = new int[] { 7, 4, 1 };

I want to find the Biggest, smallest, second smallest

If the array is as follows,

int[] array = new int[] { 7, 4 };

I want to find the Biggest, smallest

How can i achieve this programmaticly.

© Stack Overflow or respective owner

Related posts about c#

Related posts about homework